/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package views;

import healthcare.coursework.service.UserService;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.util.GenericComposer;
import org.zkoss.zul.Image;
import org.zkoss.zul.Label;

/**
 *
 * @author Administrator
 */
public class AccountInfo extends GenericComposer {

    private Image imgUser;
    private UserService userService;
    private Label lblUsername;
      @Override
    public void doAfterCompose(Component win) throws Exception {
           //locate ZK components
          imgUser= (Image) win.getFellow("imgUser");
          lblUsername=(Label) win.getFellow("username");
        userService=util.Utility.getUtility().getUserService();
        System.out.println(util.Utility.getUsername()+"-"+"/img/DoctorImage/"+userService.findUser(util.Utility.getUsername()).getImage());
        imgUser.setSrc("/img/DoctorImage/"+userService.findUser(util.Utility.getUsername()).getImage());
        lblUsername.setValue("Welcome "+util.Utility.getUsername()+"!!!");
      }
}
